package com.feiyi.app.net;

import com.feiyi.app.bean.AddressDetailBean;
import com.feiyi.app.bean.AddressListBean;
import com.feiyi.app.bean.ArticleBean;
import com.feiyi.app.bean.CartListBean;
import com.feiyi.app.bean.ChangeHeadBean;
import com.feiyi.app.bean.CheckOrderBean;
import com.feiyi.app.bean.ClassifyLeftBean;
import com.feiyi.app.bean.ClassifyRightBean;
import com.feiyi.app.bean.CommonBean;
import com.feiyi.app.bean.GoodsAddToCartBean;
import com.feiyi.app.bean.GoodsDetailBean;
import com.feiyi.app.bean.GoodsSearchBean;
import com.feiyi.app.bean.HomePageBean;
import com.feiyi.app.bean.JifenBean;
import com.feiyi.app.bean.MyYouhuiBean;
import com.feiyi.app.bean.OrderDoneBean;
import com.feiyi.app.bean.OrderListBean;
import com.feiyi.app.bean.RegionBean;
import com.feiyi.app.bean.RegisterBean;
import com.feiyi.app.bean.UpdateCartBean;

import butterknife.BindView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * 作者 : wlt
 * 创建时间:  2018-07-14
 * QQ : 1346947404
 * 邮箱:wanglt_android@163.com
 * 类说明:全部接口解析
 * In me the tiger sniffs the rose
 */

public interface RequestInfonApi {
    /**
     *
     * 错误码
     * 6   => '用户名或者密码错误',
     8 	=>	'处理失败',
     11  => '用户名或email已使用',
     13  => '不存在的信息',
     14	=>	'购买失败',
     100 => '您的帐号已过期',
     101 => '协议格式错误101',
     501 => '协议格式错误501',
     502 => '协议格式错误502',
     503 => '合同期终止',
     10001=>'您必须选定一个配送方式',
     10002=>'购物车中没有商品',
     10003=>'您的余额不足以支付整个订单，请选择其他支付方式',
     10005=>'您选择的超值礼包数量已经超出库存。请您减少购买量或联系商家。',
     10006=>'如果是团购，且保证金大于0，不能使用货到付款',
     10007=>'您已收藏过此商品',
     10008=>'库存不足',
     10009=>'订单无发货信息'
     */

    @Deprecated
    @POST("/home/index")
    Observable<HomePageBean> getHomePage();
    //获取首页数据
    @POST()
    Observable<HomePageBean> getHomePage1(@Url String url);
    /**
     * 获取分类模块左侧数据
     */
    @POST()
    Observable<ClassifyLeftBean> getClassifyLeft(@Url String url);
    /**
     * 获取分类模块右侧数据
     */
    @POST()
    Observable<ClassifyRightBean> getClassifyRight(@Url String url,
                                                  /* @Query("cat_id") String cat_id*/
                                                  @Body RequestBody body
                                                   );
    /**
      * 获取搜索的数据的接口
     */
    @POST()
    Observable<GoodsSearchBean> getSearch(@Url String url,
                                        /*  @Query("keywords") String keywords,
                                          @Query("category_id") String category_id,
                                          @Query("price_min") String price_min,
                                          @Query("price_max") String price_max,
                                          @Query("brand_id") String brand_id,
                                          @Query("sort_by") String sort_by,
                                          @Query("page") String page,
                                          @Query("count") String count*/
                                        @Body RequestBody body
    );
    /**
     * 获取文章详情的接口
     */
    @POST()
    Observable<ArticleBean> getArticle(@Url String url,
                                       /*@Query("article_id") String article_id*/
                                       @Body RequestBody body
                                       );
    /**
     * 获取商品详情接口
     */
    @POST()
    Observable<GoodsDetailBean> getGoodsDetail(@Url String url,
                                              /* @Query("goods_id") String goods_id
                                              * @Query("uid") String uid
                                              * @Query("sid") String sid
                                              * */
                                              @Body RequestBody body
                                               );
    /**
     * 用户注册接口
     */
    @POST()
    Observable<RegisterBean> doRegister(@Url String url,
                                        /*name=123,email=123,password=123*/
                                        @Body RequestBody body
                                        );
    /**
     * 用户登录接口
     */
    @POST()
    Observable<RegisterBean> doLogin(@Url String url,
                                        /*name=123,password=123*/
                                        @Body RequestBody body
    );
    /**
     * 添加到购物车
     * uid:
     *sid:
     *goods_id
     *number
     */
    @POST()
    Observable<GoodsAddToCartBean> addToCart(@Url String url,
                                             @Body RequestBody body
                                             );
    /**
     * 获取购物车列表
     * uid
     * sid
     */
    @POST()
    Observable<CartListBean> getCartList(@Url String url,@Body RequestBody body);
    /**
     * 更新商品购物车
     * uid
     * sid
     * rec_id
     * new_number
     */
    @POST()
    Observable<UpdateCartBean> updateCart(@Url String url,
                                          @Body RequestBody body
                                          );
    /**
     * 获取用户收藏
     * uid
     * sid
     */
    @POST()
    Observable<GoodsSearchBean> getCollectList(@Url String url,
                                          @Body RequestBody body
    );
    /**
     * 获取用户积分列表
     * uid
     * sid
     */
    @POST()
    Observable<JifenBean> getJifenList(@Url String url,
                                         @Body RequestBody body
    );
    /**
     * 获取用户积分列表
     * uid
     * sid
     */
    @POST()
    Observable<MyYouhuiBean> getYouhuiList(@Url String url,
                                           @Body RequestBody body
    );
    /**
     * 发送验证码
     * name
     *
     */
    @POST()
    Observable<CommonBean> sendYanzhengma(@Url String url,
                                         @Body RequestBody body
    );
    /**
     * 找回密码
     * name
     *
     */
    @POST()
    Observable<CommonBean> getpsd(@Url String url,
                                         @Body RequestBody body
    );
    /**
     * 获取地区
     * parent_id
     *
     */
    @POST()
    Observable<RegionBean> getRegion(@Url String url,
                                  @Body RequestBody body
    );
    /**
     * 上传地址
     * uid
     * sid'
     * name
     * country
     * province
     * city
     * district
     * address
     * zipcode
     * mobile
     * default_address
     */
    @POST()
    Observable<CommonBean> upDateAddress(@Url String url,
                                  @Body RequestBody body
    );
    /**
     * 地址列表
     * uid
     * sid'
     */
    @POST()
    Observable<AddressListBean> getAddressList(@Url String url,
                                              @Body RequestBody body
    );
    /**
     * 地址详情
     * uid
     * sid'
     */
    @POST()
    Observable<AddressDetailBean> getAddressDetail(@Url String url,
                                                 @Body RequestBody body
    );
    /**
     * 地址详情
     * uid
     * sid
     * address_id
     * name
     * country
     * province
     * city
     * district
     * address
     * zipcode
     * mobile
     * default_address
     */
    @POST()
    Observable<CommonBean> updateAddressDetail(@Url String url,
                                                 @Body RequestBody body
    );

    /**
     *在线反馈
     * uid
     * sid
     * content
     * title
     */
    @POST()
    Observable<CommonBean> feedBack(@Url String url,
                                                 @Body RequestBody body
    );

    /**
     *uid
     *sid
     *page
     * count
     * type await_pay 待付款 await_ship 待发货 shipped 待收货 finished 历史订单 all 全部订单
     */
    @POST()
    Observable<OrderListBean> getOrderList(@Url String url,
                                           @Body RequestBody body
    );

    /**
     *uid
     *sid
     */
    @POST()
    Observable<CheckOrderBean> checkOrder(@Url String url,
                                          @Body RequestBody body
    );
    /**
     *uid
     *sid
     * pay_id
     * shipping_id
     * bonus
     * address_id
     */
    @POST()
    Observable<OrderDoneBean> orderDone(@Url String url,
                                         @Body RequestBody body
    );

    /**
     * 上传生日
     * @param url 链接
     * @param body uid,sid,birthday
     * @return
     */
    @POST()
    Observable<RegisterBean> updateBirthday(@Url String url,
                                        @Body RequestBody body
    );
    /**
     * 上传性别
     * @param url 链接
     * @param body uid,sid,sex(1,男；2，女)
     * @return
     */
    @POST()
    Observable<RegisterBean> updateSex(@Url String url,
                                            @Body RequestBody body
    );
    /**
     * 上传头像
     * @param url 链接
     * @param body uid,sid,avatar头像的base64编码的字符串
     * @return
     */
    @POST()
    Observable<ChangeHeadBean> updateHead(@Url String url,
                                          @Body RequestBody body
    );
}
